<? require_once('admin/dbconnect.php'); ?>
<?php require_once('admin/conf.php'); ?>
<html>
<head><title>Open Video</title>
</head>
<style>
a
{
color:#fff000;
}

a:hover
{
color:#ff0000;
}
</style>
<body bgcolor='#dddfff' text='#0000ff'>
<center>
<? 
function sanitizer($variable)
{  
$variable=trim($variable);
$variable=strip_tags($variable);
$variable=htmlentities($variable);
$variable=addslashes($variable);  

return $variable;
}

$id=sanitizer($_GET['id']);


$query=sprintf("SELECT * FROM videos WHERE id='$id'",
$id=sanitizer($_GET['id']));
$result = mysql_query($query) or die ("Error ".mysql_error());
$row=mysql_fetch_array($result);

$id=$row['id'];
$videoname=$row['videoname'];
$videocode=$row['videocode'];
$counter=$row['counter'];

$counter++;
$query=" UPDATE videos SET counter='$counter' WHERE id='$id'";
$result=mysql_query($query);

echo "<font size=\"2\">$videoname - <font color=\"#ff0000\">$counter</font> Views";
?>
&nbsp; &nbsp;
<a href="full.php?id=<? echo $id; ?>" target="_blank">Full Screen</a>
</font>
<br>
<? 
print $videocode;
?>
</center>
</body>
</html>
